package com.zb.servlet;


import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zb.service.UserService;
import com.zb.service.impl.UserServiceImpl;

public class DeleteUserServlet extends HttpServlet {

	
	private UserService userService = new UserServiceImpl();
	
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		int id = Integer.parseInt(request.getParameter("id"));
		int flag = userService.deleteUserById(id);
		request.setAttribute("deleteFlag", flag);
		request.getRequestDispatcher("WEB-INF/jsp/user/userlist.jsp").forward(request, response);
	}
	
}
